]> dgit.raspbian.org Git - gnome-shell.git/commit
st-box-layout: Pass correct allocation box to layout manager
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 24 Aug 2018 00:41:00 +0000 (21:41 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 9 Oct 2018 01:42:24 +0000 (22:42 -0300)
commit2717ca9d080ebe57014d307993af673797a9f6b3
treee8417e188bde63a63604ebdd3e845767ee64bf32
parentc6cea277ebb5dd40faf9aa5f850618176b8abc3d
st-box-layout: Pass correct allocation box to layout manager

StBoxLayout implements StScrollable, which, semantically, means that
the StBoxLayout size may not match the minimum size reported by the
layout manager. In this specific case, the layout manager by is a
ClutterBoxLayout by default. For example:

        +--------------+
        |   Viewport   |
 +------+--------------+-----------------+
 |      |              |                 |
 |      |              |     Content     |
 |      |              |                 |
 +------+--------------+-----------------+
        |              |
        +--------------+

So, assuming that:

 - ContentSize = the minimum size of the content;
 - ViewportSize = the allocated size of the viewport;

When allocating StBoxLayout, it must assume ViewportSize, but must
pass ContentSize to the layout manager. That way, the children of
StBoxLayout are correctly placed within it, even if it's bigger than
ViewportSize.

And here's the problem: right now, StBoxLayout assumes ViewportSize
AND also passes it to layout manager. Commit 77c4c6b6d specifically
exposed this bug by relying entirely on StBoxLayout to arrange the
app and window icons.

Fix that by using ViewportSize to allocate StBoxLayout itself, but
passing ContentSize to the layout manager.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
src/st/st-box-layout.c